package org.noear.solon.boot.netty.server;

import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.Executor;

import javax.net.ssl.SSLContext;

import org.noear.solon.server.ServerConstants;
import org.noear.solon.server.ServerLifecycle;
import org.noear.solon.server.http.HttpServerConfigure;
import org.noear.solon.server.prop.impl.HttpServerProps;
import org.noear.solon.server.ssl.SslConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.github.netty.core.util.LoggerFactoryX;
import com.github.netty.core.util.LoggerX;

public class NettyTcpServerBase implements ServerLifecycle, HttpServerConfigure{
	private static final LoggerX logger = LoggerFactoryX.getLogger(NettyTcpServerBase.class);
	
	protected Executor executor;
	protected final HttpServerProps props;
    protected SslConfig sslConfig = new SslConfig(ServerConstants.SIGNAL_HTTP);

    protected Set<Integer> addHttpPorts = new LinkedHashSet<>();

    protected boolean enableHttp2 = false;

    public NettyTcpServerBase(HttpServerProps props) {
        this.props = props;
    }

	
	@Override
	public void enableSsl(boolean enable, SSLContext sslContext) {
		sslConfig.set(enable, sslContext);
	}

	@Override
	public void addHttpPort(int port) {
		addHttpPorts.add(port);
	}

	@Override
	public void setExecutor(Executor executor) {
		this.executor = executor;
	}

	@Override
	public void start(String host, int port) throws Throwable {
		
	}

	@Override
	public void stop() throws Throwable {
		
	}

}
